using System;
using System.Collections.Generic;
using System.Text;

namespace Kenly.DBFramework.Gateway
{
    /// <summary>
    ///  Database factory to create instance of database interfaces.
    /// </summary>
    internal static class ParameterBuilderFactory
    {

        /// <summary>
        /// Creates instance of database.
        /// </summary>
        /// <param name="databaseType"></param>
        /// <returns></returns>
        public static IParameterBuilder CreateInstance(DatabaseType databaseType)
        {
            IParameterBuilder parameterBuilder = null;
            switch (databaseType)
            {
                case DatabaseType.SqlServer: parameterBuilder = new SqlParameterBuilder();
                    break;
                case DatabaseType.Oracle: parameterBuilder = new OracleParameterBuilder();
                    break;
                case DatabaseType.Oledb: parameterBuilder = new OleParameterBuilder();
                    break;
                default: parameterBuilder = new SqlParameterBuilder();
                    break;
            }
            return parameterBuilder;
        }

    }
}
